<template>
  <div class="page-container">
    <div v-if="isShowSide" class="page-sidebar">
      <slot name="sidebar"></slot>
    </div>
    <div class="page-content" :class="{ isShowSide: isShowSide }">
      <div class="page-content-wrap">
        <slot name="content"></slot>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'PageContent',
  props: {
    isShowSide: {
      type: Boolean,
      required: false,
      default: true
    }
  }
}
</script>
<style lang="less">
.page-container {
  display: flex;
  min-height: 100%;
  .page-sidebar {
    max-width: 160px;
    min-width: 160px;
    width: 160px;
    min-height: 100%;
  }
  .page-content {
    flex: 1;
    min-height: 100%;
    box-sizing: border-box;
    padding: 16px;
    .page-content-wrap {
      min-height: 100vh;
    }
  }
  // 页面spin加载
  .isShowSide .loading-dot .ant-spin .ant-spin-dot {
    margin-left: 120px;
  }
  .loading-dot .ant-spin .ant-spin-dot {
    position: fixed;
    left: 50%;
    margin-left: 40px;
  }
}
</style>
